import request from '@/utils/request'

// 查询库存调整主表列表
export function listInventoryAdjust(query) {
  return request({
    url: '/repertory/InventoryAdjust/list',
    method: 'get',
    params: query
  })
}

//
export function listKtdDet(ktdDjbh) {
  return request({
    url: '/repertory/InventoryAdjust/listKcd/' + ktdDjbh,
    method: 'get'
  })
}

// 查询库存调整主表详细
export function getInventoryAdjust(ktmId) {
  return request({
    url: '/repertory/InventoryAdjust/' + ktmId,
    method: 'get'
  })
}

// 新增库存调整主表
export function addInventoryAdjust(data) {
  return request({
    url: '/repertory/InventoryAdjust',
    method: 'post',
    data: data
  })
}

// 修改库存调整主表
export function updateInventoryAdjust(data) {
  return request({
    url: '/repertory/InventoryAdjust',
    method: 'put',
    data: data
  })
}

// 删除库存调整主表
export function delKtmMstr(ktmDjbh) {
  return request({
    url: '/repertory/InventoryAdjust/' + ktmDjbh,
    method: 'delete'
  })
}

// 导出库存调整主表
export function exportInventoryAdjust(query) {
  return request({
    url: '/repertory/InventoryAdjust/export',
    method: 'get',
    params: query
  })
}

// 获取需要添加的数据
export function getNeedData(query) {
  return request({
    url: '/repertory/InventoryAdjust/getNeedData',
    method: 'get',
    params: query
  })
}


// 删除子项明细数据
export function delKtdDet(ktdId) {
  return request({
    url: '/repertory/InventoryAdjust/delKtdDet/' + ktdId,
    method: 'delete'
  })
}

//添加确认
export function addNeedData(data) {
  return request({
    url: '/repertory/InventoryAdjust/addNeedData',
    method: 'post',
    data: data
  })
}

export function submitCkm(ktmDjbh) {
  return request({
    url: '/repertory/InventoryAdjust/submitCkm/' + ktmDjbh,
    method: 'put'
  })
}

export function approvalKtm(ktmDjbh) {
  return request({
    url: '/repertory/InventoryAdjust/approvalKtm/' + ktmDjbh,
    method: 'put'
  })
}

export function backKtm(ktmDjbh, backReson) {
  return request({
    url: '/repertory/InventoryAdjust/backKtm/' + ktmDjbh + '/' + backReson,
    method: 'put'
  })
}

export function postKtm(ktmDjbh) {
  return request({
    url: '/repertory/InventoryAdjust/postKtm/' + ktmDjbh,
    method: 'put'
  })
}


